//--------------------------------------------------------------------------
// 
//  Copyright (c) Chili Software.  All rights reserved. 
// 
//  File: OESortByMember.cs
//
//  Description: SortBy member for the ObjectExpression.
// 
//--------------------------------------------------------------------------

using System;

namespace Chili.Opf3.Query.OPathParser
{
	/// <summary>
	/// Represents a single sort expression in the OPath statement. 
	/// </summary>
	/// <remarks>
	/// SortBy members in a OPath statement are converted to instances of
	/// this class when OPath is compiled.
	/// </remarks>
	[Serializable]
	public sealed class OESortByMember : OEItem
	{
		private SortOrders _sortOrder = SortOrders.Ascending;

		/// <summary>
		/// Creates a new instance of the <see cref="OESortByMember">OESortByMember Class</see>.
		/// </summary>
		/// <param name="sortOrder">Specifies the sort direction.</param>
		internal OESortByMember(SortOrders sortOrder)
		{
			_sortOrder = sortOrder;
		}

		/// <summary>
		/// Returns the sort direction.
		/// </summary>
		/// <value>Sort direction of the SortBy statement.</value>
		public SortOrders SortOrder
		{
			get { return _sortOrder; }
		}
	}
}
